﻿using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;

namespace Exam.infranstuctrue.EFCore
{
    public partial class Exam_KoalaStadyContext : DbContext
    {
        public Exam_KoalaStadyContext()
        {
        }

        public Exam_KoalaStadyContext(DbContextOptions<Exam_KoalaStadyContext> options)
            : base(options)
        {
        }

        public virtual DbSet<ExamArrange> ExamArranges { get; set; } = null!;
        public virtual DbSet<ExamCourse> ExamCourses { get; set; } = null!;
        public virtual DbSet<ExamCourseProcess> ExamCourseProcesses { get; set; } = null!;
        public virtual DbSet<ExamExercise> ExamExercises { get; set; } = null!;
        public virtual DbSet<ExamExerciseDetail> ExamExerciseDetails { get; set; } = null!;
        public virtual DbSet<ExamOption> ExamOptions { get; set; } = null!;
        public virtual DbSet<ExamQuestion> ExamQuestions { get; set; } = null!;
        public virtual DbSet<ExamQuestionBank> ExamQuestionBanks { get; set; } = null!;
        public virtual DbSet<ExamQuestionBankDetali> ExamQuestionBankDetalis { get; set; } = null!;
        public virtual DbSet<ExamSimulation> ExamSimulations { get; set; } = null!;
        public virtual DbSet<ExamStage> ExamStages { get; set; } = null!;
        public virtual DbSet<ExamStageDetail> ExamStageDetails { get; set; } = null!;
        public virtual DbSet<ExamStageDetailQuestion> ExamStageDetailQuestions { get; set; } = null!;
        public virtual DbSet<ExamStageHistory> ExamStageHistories { get; set; } = null!;
        public virtual DbSet<ExamTask> ExamTasks { get; set; } = null!;
        public virtual DbSet<ExamTaskDetail> ExamTaskDetails { get; set; } = null!;
        public virtual DbSet<ExamTaskDetailProcess> ExamTaskDetailProcesses { get; set; } = null!;
        public virtual DbSet<ExamTestPaper> ExamTestPapers { get; set; } = null!;
        public virtual DbSet<ExamTestPaperDetail> ExamTestPaperDetails { get; set; } = null!;
        public virtual DbSet<ExamUserAnswer> ExamUserAnswers { get; set; } = null!;
        public virtual DbSet<ExamUserAnswerDetail> ExamUserAnswerDetails { get; set; } = null!;
        public virtual DbSet<ExamUserStage> ExamUserStages { get; set; } = null!;

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
                optionsBuilder.UseMySql("server=175.178.90.169;user id=root;password=Wt123456@;database=Exam_KoalaStady", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.29-mysql"));
            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.UseCollation("utf8mb4_0900_ai_ci")
                .HasCharSet("utf8mb4");

            modelBuilder.Entity<ExamArrange>(entity =>
            {
                entity.HasKey(e => e.Aid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_Arrange");

                entity.Property(e => e.Aid)
                    .HasMaxLength(50)
                    .HasColumnName("AID")
                    .HasComment("安排ID");

                entity.Property(e => e.AbeginTime)
                    .HasColumnType("datetime")
                    .HasColumnName("ABeginTime")
                    .HasComment("开始时间");

                entity.Property(e => e.AcheckPerson)
                    .HasMaxLength(999)
                    .HasColumnName("ACheckPerson")
                    .HasComment("阅卷人");

                entity.Property(e => e.AcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("ACreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Adesc)
                    .HasMaxLength(999)
                    .HasColumnName("ADesc")
                    .HasComment("安排备用字段");

                entity.Property(e => e.AendTime)
                    .HasColumnType("datetime")
                    .HasColumnName("AEndTime")
                    .HasComment("结束时间");

                entity.Property(e => e.Aexplain)
                    .HasMaxLength(999)
                    .HasColumnName("AExplain")
                    .HasComment("安排描述");

                entity.Property(e => e.AisCheck)
                    .HasColumnName("AIsCheck")
                    .HasComment("是否阅卷");

                entity.Property(e => e.Aname)
                    .HasMaxLength(50)
                    .HasColumnName("AName")
                    .HasComment("安排名");

                entity.Property(e => e.AorgIds)
                    .HasMaxLength(999)
                    .HasColumnName("AOrgIDS")
                    .HasComment("组织ID列表");

                entity.Property(e => e.ArelationId)
                    .HasMaxLength(50)
                    .HasColumnName("ARelationID")
                    .HasComment("关联ID");

                entity.Property(e => e.Astate)
                    .HasColumnName("AState")
                    .HasComment("安排状态");

                entity.Property(e => e.Atpid)
                    .HasMaxLength(50)
                    .HasColumnName("ATPID")
                    .HasComment("试卷ID");

                entity.Property(e => e.Atype)
                    .HasColumnName("AType")
                    .HasComment("安排类型 1.普通/2.培训班/3.课程测验");

                entity.Property(e => e.Auids)
                    .HasMaxLength(999)
                    .HasColumnName("AUIDS")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<ExamCourse>(entity =>
            {
                entity.HasKey(e => e.Cid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_Course");

                entity.Property(e => e.Cid)
                    .HasMaxLength(50)
                    .HasColumnName("CID")
                    .HasComment("课程测验ID");

                entity.Property(e => e.Ccid)
                    .HasMaxLength(50)
                    .HasColumnName("CCID")
                    .HasComment("课程ID");

                entity.Property(e => e.CcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("CCreateTime")
                    .HasComment("课程测试创建时间");

                entity.Property(e => e.Cdesc)
                    .HasMaxLength(999)
                    .HasColumnName("CDesc")
                    .HasComment("课程测试备用字段");

                entity.Property(e => e.CisBan)
                    .HasColumnName("CIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.CisPublish)
                    .HasColumnName("CIsPublish")
                    .HasComment("是否发布");

                entity.Property(e => e.Cno)
                    .HasColumnName("CNo")
                    .HasComment("课程测试序号");

                entity.Property(e => e.Cpid)
                    .HasMaxLength(50)
                    .HasColumnName("CPID")
                    .HasComment("章节ID");

                entity.Property(e => e.Ctid)
                    .HasMaxLength(50)
                    .HasColumnName("CTID")
                    .HasComment("试卷ID");
            });

            modelBuilder.Entity<ExamCourseProcess>(entity =>
            {
                entity.HasKey(e => e.Cpid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_CourseProcess");

                entity.Property(e => e.Cpid)
                    .HasMaxLength(50)
                    .HasColumnName("CPID")
                    .HasComment("课程刷题进度ID");

                entity.Property(e => e.Cpcid)
                    .HasMaxLength(50)
                    .HasColumnName("CPCID")
                    .HasComment("课程章节测验ID");

                entity.Property(e => e.CpcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("CPCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Cpedid)
                    .HasMaxLength(50)
                    .HasColumnName("CPEDID")
                    .HasComment("刷题ID");

                entity.Property(e => e.Cpuid)
                    .HasMaxLength(50)
                    .HasColumnName("CPUID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<ExamExercise>(entity =>
            {
                entity.HasKey(e => e.Eid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_Exercise");

                entity.Property(e => e.Eid)
                    .HasMaxLength(50)
                    .HasColumnName("EID")
                    .HasComment("刷题ID");

                entity.Property(e => e.Ecount)
                    .HasColumnName("ECount")
                    .HasComment("刷题数量");

                entity.Property(e => e.EcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("ECreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Edesc)
                    .HasMaxLength(999)
                    .HasColumnName("EDesc")
                    .HasComment("刷题备用字段");

                entity.Property(e => e.ErightCount)
                    .HasColumnName("ERightCount")
                    .HasComment("正确题数");

                entity.Property(e => e.Etimestamp)
                    .HasColumnName("ETimestamp")
                    .HasComment("刷题时长");

                entity.Property(e => e.Euid)
                    .HasMaxLength(50)
                    .HasColumnName("EUID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<ExamExerciseDetail>(entity =>
            {
                entity.HasKey(e => e.Edid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_ExerciseDetails");

                entity.Property(e => e.Edid)
                    .HasMaxLength(50)
                    .HasColumnName("EDID")
                    .HasComment("刷题ID");

                entity.Property(e => e.EdcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("EDCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Edoid)
                    .HasMaxLength(50)
                    .HasColumnName("EDOID")
                    .HasComment("回答选项ID");

                entity.Property(e => e.Edqid)
                    .HasMaxLength(50)
                    .HasColumnName("EDQID")
                    .HasComment("试题ID");

                entity.Property(e => e.Eduid)
                    .HasMaxLength(50)
                    .HasColumnName("EDUID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<ExamOption>(entity =>
            {
                entity.HasKey(e => e.Oid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_Option");

                entity.Property(e => e.Oid)
                    .HasMaxLength(50)
                    .HasColumnName("OID")
                    .HasComment("选项ID");

                entity.Property(e => e.Ocontent)
                    .HasMaxLength(999)
                    .HasColumnName("OContent")
                    .HasComment("选项");

                entity.Property(e => e.Ocreatetime)
                    .HasColumnType("datetime")
                    .HasColumnName("OCreatetime")
                    .HasComment("创建时间");

                entity.Property(e => e.OisBan)
                    .HasColumnName("OIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.OisRight)
                    .HasColumnName("OIsRight")
                    .HasComment("是否正确");

                entity.Property(e => e.Oqid)
                    .HasMaxLength(50)
                    .HasColumnName("OQID")
                    .HasComment("试题ID");
            });

            modelBuilder.Entity<ExamQuestion>(entity =>
            {
                entity.HasKey(e => e.Qid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_Question");

                entity.Property(e => e.Qid)
                    .HasMaxLength(50)
                    .HasColumnName("QID")
                    .HasComment("试题ID");

                entity.Property(e => e.Qanalysi)
                    .HasMaxLength(999)
                    .HasColumnName("QAnalysi")
                    .HasComment("解析");

                entity.Property(e => e.Qanswer)
                    .HasMaxLength(999)
                    .HasColumnName("QAnswer")
                    .HasComment("试题参考答案(选择题没有)");

                entity.Property(e => e.Qauthor)
                    .HasMaxLength(50)
                    .HasColumnName("QAuthor")
                    .HasComment("试题添加人");

                entity.Property(e => e.Qcontent)
                    .HasMaxLength(999)
                    .HasColumnName("QContent")
                    .HasComment("试题题干");

                entity.Property(e => e.QcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("QCreateTime")
                    .HasComment("试题创建时间");

                entity.Property(e => e.Qdesc)
                    .HasMaxLength(999)
                    .HasColumnName("QDesc")
                    .HasComment("试题备用字段");

                entity.Property(e => e.Qexplain)
                    .HasMaxLength(999)
                    .HasColumnName("QExplain")
                    .HasComment("试题描述");

                entity.Property(e => e.QisBan)
                    .HasColumnName("QIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.QisCheck)
                    .HasColumnName("QIsCheck")
                    .HasComment("是否主观");

                entity.Property(e => e.QisPublish)
                    .HasColumnName("QIsPublish")
                    .HasComment("是否发布");

                entity.Property(e => e.Qlable)
                    .HasMaxLength(50)
                    .HasColumnName("QLable")
                    .HasComment("试题标签");

                entity.Property(e => e.Qlv)
                    .HasColumnName("QLv")
                    .HasComment("试题等级");

                entity.Property(e => e.Qstate)
                    .HasColumnName("QState")
                    .HasComment("状态");

                entity.Property(e => e.Qtype)
                    .HasColumnName("QType")
                    .HasComment("类型");
            });

            modelBuilder.Entity<ExamQuestionBank>(entity =>
            {
                entity.HasKey(e => e.Qbid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_QuestionBank");

                entity.Property(e => e.Qbid)
                    .HasMaxLength(50)
                    .HasColumnName("QBID")
                    .HasComment("题库ID");

                entity.Property(e => e.Qbcount)
                    .HasColumnName("QBCount")
                    .HasComment("题库数");

                entity.Property(e => e.QbcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("QBCreateTime")
                    .HasComment("题库创建时间");

                entity.Property(e => e.Qbdesc)
                    .HasMaxLength(999)
                    .HasColumnName("QBDesc")
                    .HasComment("题库备用字段");

                entity.Property(e => e.Qbexplain)
                    .HasMaxLength(999)
                    .HasColumnName("QBExplain")
                    .HasComment("题库描述");

                entity.Property(e => e.QbisBan)
                    .HasColumnName("QBIsBan")
                    .HasComment("题库是否禁用");

                entity.Property(e => e.QbisPublish)
                    .HasColumnName("QBIsPublish")
                    .HasComment("题库是否发布");

                entity.Property(e => e.Qblable)
                    .HasMaxLength(999)
                    .HasColumnName("QBLable")
                    .HasComment("题库标签");

                entity.Property(e => e.Qblv)
                    .HasColumnName("QBLv")
                    .HasComment("题库等级");

                entity.Property(e => e.Qbname)
                    .HasMaxLength(50)
                    .HasColumnName("QBName")
                    .HasComment("题库名");

                entity.Property(e => e.Qbno)
                    .HasColumnName("QBNo")
                    .HasComment("题库序号");

                entity.Property(e => e.Qbstate)
                    .HasColumnName("QBState")
                    .HasComment("题库状态");
            });

            modelBuilder.Entity<ExamQuestionBankDetali>(entity =>
            {
                entity.HasKey(e => e.Qbdid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_QuestionBankDetali");

                entity.Property(e => e.Qbdid)
                    .HasMaxLength(50)
                    .HasColumnName("QBDID")
                    .HasComment("题库详情ID");

                entity.Property(e => e.Qbdesc)
                    .HasMaxLength(999)
                    .HasColumnName("QBDesc")
                    .HasComment("题库详情备用字段");

                entity.Property(e => e.Qbdqbid)
                    .HasMaxLength(50)
                    .HasColumnName("QBDQBID")
                    .HasComment("题库ID(外键)");

                entity.Property(e => e.QbisState)
                    .HasColumnName("QBIsState")
                    .HasComment("题库详情状态");

                entity.Property(e => e.Qbqid)
                    .HasMaxLength(50)
                    .HasColumnName("QBQID")
                    .HasComment("试题ID(外键)");
            });

            modelBuilder.Entity<ExamSimulation>(entity =>
            {
                entity.HasKey(e => e.Sid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_Simulation");

                entity.Property(e => e.Sid)
                    .HasMaxLength(50)
                    .HasColumnName("SID")
                    .HasComment("模拟ID");

                entity.Property(e => e.ScreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("SCreateTime")
                    .HasComment("模拟创建时间");

                entity.Property(e => e.Sdesc)
                    .HasMaxLength(999)
                    .HasColumnName("SDesc")
                    .HasComment("模拟备用字段");

                entity.Property(e => e.SfinishTime)
                    .HasColumnType("datetime")
                    .HasColumnName("SFinishTime")
                    .HasComment("模拟结束时间");

                entity.Property(e => e.Sscore)
                    .HasColumnName("SScore")
                    .HasComment("模拟得分");

                entity.Property(e => e.Stid)
                    .HasMaxLength(50)
                    .HasColumnName("STID")
                    .HasComment("试卷ID");

                entity.Property(e => e.Suid)
                    .HasMaxLength(50)
                    .HasColumnName("SUID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<ExamStage>(entity =>
            {
                entity.HasKey(e => e.Sid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_Stage");

                entity.Property(e => e.Sid)
                    .HasMaxLength(50)
                    .HasColumnName("SID")
                    .HasComment("关卡ID");

                entity.Property(e => e.SbeginTime)
                    .HasColumnType("datetime")
                    .HasColumnName("SBeginTime")
                    .HasComment("关卡开始时间");

                entity.Property(e => e.Scount)
                    .HasColumnName("SCount")
                    .HasComment("内置关卡数量");

                entity.Property(e => e.ScreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("SCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Sdesc)
                    .HasMaxLength(999)
                    .HasColumnName("SDesc")
                    .HasComment("关卡备用字段");

                entity.Property(e => e.SendTime)
                    .HasColumnType("datetime")
                    .HasColumnName("SEndTime")
                    .HasComment("结束时间");

                entity.Property(e => e.Sexplain)
                    .HasMaxLength(999)
                    .HasColumnName("SExplain")
                    .HasComment("关卡描述");

                entity.Property(e => e.SisBan)
                    .HasColumnName("SIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.SisPublish)
                    .HasColumnName("SIsPublish")
                    .HasComment("是否发布");

                entity.Property(e => e.Sisrepeat)
                    .HasColumnName("SIsrepeat")
                    .HasComment("是否允许重复闯关");

                entity.Property(e => e.Slabel)
                    .HasMaxLength(999)
                    .HasColumnName("SLabel")
                    .HasComment("标签列表");

                entity.Property(e => e.Slv)
                    .HasColumnName("SLv")
                    .HasComment("关卡等级");

                entity.Property(e => e.Sname)
                    .HasMaxLength(50)
                    .HasColumnName("SName")
                    .HasComment("关卡名");

                entity.Property(e => e.Sno)
                    .HasColumnName("SNo")
                    .HasComment("关卡序号");

                entity.Property(e => e.Sorgs)
                    .HasMaxLength(999)
                    .HasColumnName("SOrgs")
                    .HasComment("关卡所对应的组织列表 如果不设定则规定所有人都可以进行闯关");

                entity.Property(e => e.Spart)
                    .HasColumnName("SPart")
                    .HasComment("系列中序号 按照这个顺序来显示系列中的关卡 且需要完成前置任务");

                entity.Property(e => e.SpassCount)
                    .HasColumnName("SPassCount")
                    .HasComment("通过次数一个人只计算一次");

                entity.Property(e => e.Sphoto)
                    .HasMaxLength(999)
                    .HasColumnName("SPhoto")
                    .HasComment("封面");

                entity.Property(e => e.Srule)
                    .HasColumnName("SRule")
                    .HasComment("闯关规则 1总共几次 2每周几次 3每月几次");

                entity.Property(e => e.SruleCount)
                    .HasColumnName("SRuleCount")
                    .HasComment("对应规则次数");

                entity.Property(e => e.Sseries)
                    .HasMaxLength(50)
                    .HasColumnName("SSeries")
                    .HasComment("关卡系列 如果是连续关卡则关卡系列应该相同");

                entity.Property(e => e.Sstate)
                    .HasColumnName("SState")
                    .HasComment("状态");
            });

            modelBuilder.Entity<ExamStageDetail>(entity =>
            {
                entity.HasKey(e => e.Sdid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_StageDetails");

                entity.Property(e => e.Sdid)
                    .HasMaxLength(50)
                    .HasColumnName("SDID")
                    .HasComment("关卡详情ID");

                entity.Property(e => e.Sdcount)
                    .HasColumnName("SDCount")
                    .HasComment("内置题目数量");

                entity.Property(e => e.Sdcourse)
                    .HasMaxLength(999)
                    .HasColumnName("SDCourse")
                    .HasComment("关卡涉及到哪些课程");

                entity.Property(e => e.SdcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("SDCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Sdesc)
                    .HasMaxLength(999)
                    .HasColumnName("SDesc")
                    .HasComment("关卡详情备用字段");

                entity.Property(e => e.SdisBan)
                    .HasColumnName("SDIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.Sdlabels)
                    .HasMaxLength(999)
                    .HasColumnName("SDLabels")
                    .HasComment("标签");

                entity.Property(e => e.Sdlv)
                    .HasColumnName("SDLv")
                    .HasComment("难度");

                entity.Property(e => e.Sdname)
                    .HasMaxLength(50)
                    .HasColumnName("SDName")
                    .HasComment("详情名");

                entity.Property(e => e.Sdpart)
                    .HasColumnName("SDPart")
                    .HasComment("关卡顺序");

                entity.Property(e => e.SdpassCount)
                    .HasColumnName("SDPassCount")
                    .HasComment("通过次数一个人只计算一次");

                entity.Property(e => e.Sdphoto)
                    .HasMaxLength(999)
                    .HasColumnName("SDPhoto")
                    .HasComment("详情封面");

                entity.Property(e => e.Sdrule)
                    .HasColumnName("SDRule")
                    .HasComment("关卡生成规则 1:固定题目 2:随机题目");

                entity.Property(e => e.Sdsid)
                    .HasMaxLength(50)
                    .HasColumnName("SDSID")
                    .HasComment("关卡ID");

                entity.Property(e => e.SdsingleTimeStamp)
                    .HasColumnName("SDSingleTimeStamp")
                    .HasComment("每道题的答题时间单位秒 与总时间互斥");

                entity.Property(e => e.Sdstate)
                    .HasColumnName("SDState")
                    .HasComment("状态");

                entity.Property(e => e.SdtotalTimeStamp)
                    .HasColumnName("SDTotalTimeStamp")
                    .HasComment("当前关卡的总时间 与单个时间互斥");
            });

            modelBuilder.Entity<ExamStageDetailQuestion>(entity =>
            {
                entity.HasKey(e => e.Sdqid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_StageDetailQuestions");

                entity.Property(e => e.Sdqid)
                    .HasMaxLength(50)
                    .HasColumnName("SDQID")
                    .HasComment("关卡详情对应试题ID");

                entity.Property(e => e.SdqcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("SDQCreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.Sdqno)
                    .HasColumnName("SDQNo")
                    .HasComment("序号");

                entity.Property(e => e.SdqpassCount)
                    .HasColumnName("SDQPassCount")
                    .HasComment("通过次数 一个人只计算一次");

                entity.Property(e => e.Sdqqid)
                    .HasMaxLength(50)
                    .HasColumnName("SDQQID")
                    .HasComment("试题ID");

                entity.Property(e => e.Sdqsdid)
                    .HasMaxLength(50)
                    .HasColumnName("SDQSDID")
                    .HasComment("详情ID");

                entity.Property(e => e.SdqtimeStamp)
                    .HasColumnName("SDQTimeStamp")
                    .HasComment("当前题目答题时间 如果设置了这个时间 则其他时间会失效");
            });

            modelBuilder.Entity<ExamStageHistory>(entity =>
            {
                entity.HasKey(e => e.Shid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_StageHistory");

                entity.Property(e => e.Shid)
                    .HasMaxLength(50)
                    .HasColumnName("SHID")
                    .HasComment("闯关历史ID");

                entity.Property(e => e.Shanswer)
                    .HasMaxLength(999)
                    .HasColumnName("SHAnswer")
                    .HasComment("回答");

                entity.Property(e => e.ShcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("SHCreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.Shdesc)
                    .HasMaxLength(999)
                    .HasColumnName("SHDesc")
                    .HasComment("闯关历史备用字段");

                entity.Property(e => e.ShisPass)
                    .HasColumnName("SHIsPass")
                    .HasComment("是否通过");

                entity.Property(e => e.Shsdid)
                    .HasMaxLength(50)
                    .HasColumnName("SHSDID")
                    .HasComment("对应关卡详情");

                entity.Property(e => e.Shsdqid)
                    .HasMaxLength(50)
                    .HasColumnName("SHSDQID")
                    .HasComment("如果是确定试题 则为关卡对应试题(Exam_StageDetailQuestions)ID 否则应该为试题ID");

                entity.Property(e => e.ShtimeStamp)
                    .HasColumnName("SHTimeStamp")
                    .HasComment("花费时间");

                entity.Property(e => e.Shtype)
                    .HasColumnName("SHType")
                    .HasComment("类型 1:固定试题，2:随机试题");

                entity.Property(e => e.Shuid)
                    .HasMaxLength(50)
                    .HasColumnName("SHUID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<ExamTask>(entity =>
            {
                entity.HasKey(e => e.Tid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_Task");

                entity.Property(e => e.Tid)
                    .HasMaxLength(50)
                    .HasColumnName("TID")
                    .HasComment("任务ID");

                entity.Property(e => e.TbeginTime)
                    .HasColumnType("datetime")
                    .HasColumnName("TBeginTime")
                    .HasComment("任务开始时间");

                entity.Property(e => e.Tcount)
                    .HasColumnName("TCount")
                    .HasComment("任务数量");

                entity.Property(e => e.Tcourses)
                    .HasMaxLength(999)
                    .HasColumnName("TCourses")
                    .HasComment("课程ID列表");

                entity.Property(e => e.Tcycle)
                    .HasColumnName("TCycle")
                    .HasComment("任务周期 总共1次,1天1次,1周一次,1月1次等");

                entity.Property(e => e.Tdesc)
                    .HasMaxLength(999)
                    .HasColumnName("TDesc")
                    .HasComment("备用字段");

                entity.Property(e => e.TendTime)
                    .HasColumnType("datetime")
                    .HasColumnName("TEndTime")
                    .HasComment("任务结束时间");

                entity.Property(e => e.TisTrain)
                    .HasColumnName("TIsTrain")
                    .HasComment("是否培训班任务");

                entity.Property(e => e.Tlabels)
                    .HasMaxLength(999)
                    .HasColumnName("TLabels")
                    .HasComment("任务标签");

                entity.Property(e => e.TmaxLv)
                    .HasColumnName("TMaxLv")
                    .HasComment("任务最大难度");

                entity.Property(e => e.TminLv)
                    .HasColumnName("TMinLv")
                    .HasComment("任务最小难度");

                entity.Property(e => e.TorgIds)
                    .HasMaxLength(999)
                    .HasColumnName("TOrgIDS")
                    .HasComment("安排的组织ID");

                entity.Property(e => e.TtrainId)
                    .HasMaxLength(50)
                    .HasColumnName("TTrainID")
                    .HasComment("培训班ID");
            });

            modelBuilder.Entity<ExamTaskDetail>(entity =>
            {
                entity.HasKey(e => e.Tdid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_TaskDetail");

                entity.Property(e => e.Tdid)
                    .HasMaxLength(50)
                    .HasColumnName("TDID")
                    .HasComment("任务详情ID");

                entity.Property(e => e.TdbeginTime)
                    .HasColumnType("datetime")
                    .HasColumnName("TDBeginTime")
                    .HasComment("任务开始时间");

                entity.Property(e => e.Tddesc)
                    .HasMaxLength(999)
                    .HasColumnName("TDDesc")
                    .HasComment("任务详情备用字段");

                entity.Property(e => e.TdendTime)
                    .HasColumnType("datetime")
                    .HasColumnName("TDEndTime")
                    .HasComment("任务结束时间");

                entity.Property(e => e.TdisComplete)
                    .HasColumnName("TDIsComplete")
                    .HasComment("任务是否完成");

                entity.Property(e => e.Tdpercent)
                    .HasColumnName("TDPercent")
                    .HasComment("完成进度(完成为1)");

                entity.Property(e => e.Tdtid)
                    .HasMaxLength(50)
                    .HasColumnName("TDTID")
                    .HasComment("任务ID");

                entity.Property(e => e.Tduid)
                    .HasMaxLength(50)
                    .HasColumnName("TDUID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<ExamTaskDetailProcess>(entity =>
            {
                entity.HasKey(e => e.Tdpid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_TaskDetailProcess");

                entity.Property(e => e.Tdpid)
                    .HasMaxLength(50)
                    .HasColumnName("TDPID")
                    .HasComment("任务进度ID");

                entity.Property(e => e.TdpcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("TDPCreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.Tdpedid)
                    .HasMaxLength(50)
                    .HasColumnName("TDPEDID")
                    .HasComment("刷题ID");

                entity.Property(e => e.Tdptdid)
                    .HasMaxLength(50)
                    .HasColumnName("TDPTDID")
                    .HasComment("任务详情ID");
            });

            modelBuilder.Entity<ExamTestPaper>(entity =>
            {
                entity.HasKey(e => e.Tpid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_TestPaper");

                entity.Property(e => e.Tpid)
                    .HasMaxLength(50)
                    .HasColumnName("TPID")
                    .HasComment("试卷编号");

                entity.Property(e => e.Tpcount)
                    .HasColumnName("TPCount")
                    .HasComment("试题数量");

                entity.Property(e => e.TpcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("TPCreateTime")
                    .HasComment("试卷创建时间");

                entity.Property(e => e.Tpdesc)
                    .HasMaxLength(999)
                    .HasColumnName("TPDesc")
                    .HasComment("试卷备用字段");

                entity.Property(e => e.Tpexplain)
                    .HasMaxLength(999)
                    .HasColumnName("TPExplain")
                    .HasComment("试卷描述");

                entity.Property(e => e.TpisBan)
                    .HasColumnName("TPIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.TpisPublish)
                    .HasColumnName("TPIsPublish")
                    .HasComment("是否发布");

                entity.Property(e => e.Tplabels)
                    .HasMaxLength(999)
                    .HasColumnName("TPLabels")
                    .HasComment("试卷标签");

                entity.Property(e => e.Tplv)
                    .HasColumnName("TPLv")
                    .HasComment("试卷等级");

                entity.Property(e => e.Tpmode)
                    .HasColumnName("TPMode")
                    .HasComment("试卷组卷方式(1:人工组卷 2:随机组卷)");

                entity.Property(e => e.Tpname)
                    .HasMaxLength(50)
                    .HasColumnName("TPName")
                    .HasComment("试卷名");

                entity.Property(e => e.TppassScore)
                    .HasColumnName("TPPassScore")
                    .HasComment("试卷通过成绩");

                entity.Property(e => e.Tpstate)
                    .HasColumnName("TPState")
                    .HasComment("试卷状态");

                entity.Property(e => e.TptotalScore)
                    .HasColumnName("TPTotalScore")
                    .HasComment("试卷总成绩");

                entity.Property(e => e.Tptype)
                    .HasColumnName("TPType")
                    .HasComment("试卷类型(1:普通试卷 2:模拟试卷 3:培训班试卷)");

                entity.Property(e => e.TpuseCount)
                    .HasColumnName("TPUseCount")
                    .HasComment("试卷使用数量");
            });

            modelBuilder.Entity<ExamTestPaperDetail>(entity =>
            {
                entity.HasKey(e => e.Tpdid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_TestPaperDetails");

                entity.Property(e => e.Tpdid)
                    .HasMaxLength(50)
                    .HasColumnName("TPDID")
                    .HasComment("详情ID");

                entity.Property(e => e.TpdcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("TPDCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Tpdno)
                    .HasColumnName("TPDNo")
                    .HasComment("序号");

                entity.Property(e => e.Tpdqid)
                    .HasMaxLength(50)
                    .HasColumnName("TPDQID")
                    .HasComment("试题ID");

                entity.Property(e => e.Tpdscore)
                    .HasColumnName("TPDScore")
                    .HasComment("试题分数");

                entity.Property(e => e.Tpdtpid)
                    .HasMaxLength(50)
                    .HasColumnName("TPDTPID")
                    .HasComment("试卷ID");
            });

            modelBuilder.Entity<ExamUserAnswer>(entity =>
            {
                entity.HasKey(e => e.Uaid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_UserAnswer");

                entity.Property(e => e.Uaid)
                    .HasMaxLength(50)
                    .HasColumnName("UAID")
                    .HasComment("答题卡ID");

                entity.Property(e => e.Ueaid)
                    .HasMaxLength(50)
                    .HasColumnName("UEAID")
                    .HasComment("安排ID");

                entity.Property(e => e.UecheckUid)
                    .HasMaxLength(50)
                    .HasColumnName("UECheckUID")
                    .HasComment("答题卡阅卷人ID");

                entity.Property(e => e.UecreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UECreateTime")
                    .HasComment("答题卡开始时间");

                entity.Property(e => e.Uedesc)
                    .HasMaxLength(999)
                    .HasColumnName("UEDesc")
                    .HasComment("答题卡备用字段");

                entity.Property(e => e.UefinishTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UEFinishTime")
                    .HasComment("答题卡交卷时间");

                entity.Property(e => e.Ueid)
                    .HasMaxLength(50)
                    .HasColumnName("UEID")
                    .HasComment("用户ID");

                entity.Property(e => e.UeisCheck)
                    .HasColumnName("UEIsCheck")
                    .HasComment("是否阅卷");

                entity.Property(e => e.Uescore)
                    .HasColumnName("UEScore")
                    .HasComment("答题卡分数");

                entity.Property(e => e.Uesid)
                    .HasMaxLength(50)
                    .HasColumnName("UESID")
                    .HasComment("模拟测试ID");

                entity.Property(e => e.Uestate)
                    .HasColumnName("UEState")
                    .HasComment("答题卡状态");
            });

            modelBuilder.Entity<ExamUserAnswerDetail>(entity =>
            {
                entity.HasKey(e => e.Uadid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_UserAnswerDetails");

                entity.Property(e => e.Uadid)
                    .HasMaxLength(50)
                    .HasColumnName("UADID")
                    .HasComment("答题卡详情ID");

                entity.Property(e => e.Uadanswer)
                    .HasMaxLength(999)
                    .HasColumnName("UADAnswer")
                    .HasComment("回答");

                entity.Property(e => e.UadcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UADCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Uadqid)
                    .HasMaxLength(50)
                    .HasColumnName("UADQID")
                    .HasComment("试题ID");

                entity.Property(e => e.Uadscore)
                    .HasColumnName("UADScore")
                    .HasComment("得分");

                entity.Property(e => e.Uaduaid)
                    .HasMaxLength(50)
                    .HasColumnName("UADUAID")
                    .HasComment("答题卡ID");

                entity.Property(e => e.UaisRight)
                    .HasColumnName("UAIsRight")
                    .HasComment("是否正确");
            });

            modelBuilder.Entity<ExamUserStage>(entity =>
            {
                entity.HasKey(e => e.Usid)
                    .HasName("PRIMARY");

                entity.ToTable("Exam_UserStage");

                entity.Property(e => e.Usid)
                    .HasMaxLength(50)
                    .HasColumnName("USID")
                    .HasComment("用户闯关记录ID 只记录第一次闯关信息 之后只有获得更好的成绩时才更新最好成绩");

                entity.Property(e => e.UsbestTimeStamp)
                    .HasColumnName("USBestTimeStamp")
                    .HasComment("最快用时 单位秒");

                entity.Property(e => e.UscreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("USCreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.Usdesc)
                    .HasMaxLength(999)
                    .HasColumnName("USDesc")
                    .HasComment("用户闯关备用字段");

                entity.Property(e => e.UslastPassSdid)
                    .HasMaxLength(50)
                    .HasColumnName("USLastPassSDID")
                    .HasComment("当前已经通过的最后一关ID 对应关卡详情");

                entity.Property(e => e.UspassCount)
                    .HasColumnName("USPassCount")
                    .HasComment("通关次数");

                entity.Property(e => e.UspassFirstTime)
                    .HasColumnType("datetime")
                    .HasColumnName("USPassFirstTime")
                    .HasComment("首次通过时间");

                entity.Property(e => e.Usprocess)
                    .HasColumnName("USProcess")
                    .HasComment("关卡进度 代表当前关卡已经进行到第几关");

                entity.Property(e => e.Ussid)
                    .HasMaxLength(50)
                    .HasColumnName("USSID")
                    .HasComment("关卡ID");

                entity.Property(e => e.Usstate)
                    .HasColumnName("USState")
                    .HasComment("状态");

                entity.Property(e => e.Ustop)
                    .HasColumnName("USTop")
                    .HasComment("排名");

                entity.Property(e => e.Usuid)
                    .HasMaxLength(50)
                    .HasColumnName("USUID")
                    .HasComment("用户ID");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
